<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>财务结算信息确认</title>
    <link rel="stylesheet" type="text/css" href="//img.ejiayou.com/activity/images/boon/company/reset.css"/>
    <link rel="stylesheet" href="https://img.ejiayou.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" type="text/css" href="//img.ejiayou.com/activity/images/groupon/ejyCommonCss.css">
</head>
<style type="text/css">
    [v-cloak] {
        display: none;
    }

    .header {
        margin-left: 25px;
    }

    .el-form-item {
        margin-top: 22px;
    }

    .el-table td, .el-table th.is-leaf {
        text-align: center;
    }

    .el-table--enable-row-transition .el-table__body td {
        text-align: center;
    }

    .img_item {
        width: auto;
        height: auto;
        display: block;
    }

    .dialogMask .el-dialog {
        margin-top: 0vh !important;
        overflow: auto;
        height: 100%;
        position: relative;
        background: rgba(0, 0, 0, 0);
        margin: 0 auto 0px;
    }

    .dialogMask .el-dialog .el-dialog__header {
        padding: 0px;
    }

    .confirmMask .el-dialog {
        top: 35%;
        left: 50%;
        transform: translate(-50%, -50%);
        position: absolute;
    }

    .confirmTitle {
        text-align: center;
        color: #333333;
        font-size: 18px;
    }

    .rejectTextarea {
        margin-top: 30px;
    }

    .download {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        box-sizing: border-box;
        padding-right: 20px;
    }

    body .el-table th.gutter {
        display: table-cell !important;
    }

    body {
        padding-right: 0px !important;
    }

    .photo {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 80px;
        margin-bottom: 100px;
    }

    .rotateItem {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        bottom: 0px;
        /*background: #FFFFFF;*/
        left: 0;
        z-index: 1;
    }

    .upload-demo {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .el-upload-list {
        display: none;
    }

    .dialogMask .el-dialog .el-dialog__body {
        padding: 0px !important;
        width: 100%;
        height: 100%;
    }

    .el-carousel--horizontal {
        width: 100%;
        height: 100%;
    }

    .el-carousel__container {
        width: 100%;
        height: 100%;
    }

    .el-carousel__item.is-animating {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .carouselClose {
        width: 16px;
        height: 16px;
        position: absolute;
        z-index: 33;
        right: 20px;
        top: 20px;
    }

    .carouselClose img {
        width: 16px;
        height: 16px;
    }

    .demo-form-inline {
        width: 100%;
    }
</style>
<body>
<div id="app" v-cloak>
    <div class='header'>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-row >
                <el-col :span="5">
                    <el-form-item label="油站名称">
                        <el-input v-model="formInline.stationName" clearable ></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="5">
                    <el-form-item label="工单ID">
                        <el-input v-model="formInline.workOrderId" clearable></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="5">
                    <el-form-item label="商务经理">
                        <el-select v-model="createUserId" filterable placeholder="请选择" clearable>
                            <el-option v-for="item in userList2" :key="item.user_id" :label="item.user_name"
                                       :value="item.user_id"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="4">
                    <el-form-item label="城市">
                        <el-select v-model="cityId" filterable placeholder="请选择" clearable>
                            <el-option v-for="item in cityList" :key="item.city_id" :label="item.city_name"
                                       :value="item.city_id"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="4">
                    <el-form-item label="状态">
                        <el-select v-model="orderNodeState" filterable placeholder="请选择" clearable>
                            <el-option v-for="item in stateList" :key="item.stateId" :label="item.label"
                                       :value="item.stateId"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row >
                <el-col :span="5">
                    <el-form-item label="油站对公账户名">
                        <el-input v-model="formInline.stationAccountName" clearable></el-input>
                    </el-form-item>
                </el-col>
                <el-col  :span="8">
                    <el-form-item label="工单提交时间">
                        <el-date-picker
                                v-model="workerCommitTime"
                                type="datetimerange"
                                range-separator="至"
                                @change="changeWorkerTime"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期"
                        >
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="7">
                    <el-form-item label="审批时间">
                        <el-date-picker
                                v-model="workerAuditTime"
                                type="datetimerange"
                                range-separator="至"
                                placeholder="选择审批时间"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期"
                                @change="changeAuditTime"
                        >
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="3">
                    <el-form-item>
                        <el-button type="primary" @click="onSubmit">搜索</el-button>
                    </el-form-item>
                </el-col>

            </el-row>
        </el-form>
    </div>
    <div class="download">
        <div style="position: relative;margin-right: 10px;">
            <el-upload
                    ref="upload"
                    class="upload-demo"
                    :action="activityHost + '/cwxt/work/station/finance/uploadTransResultExcel'"
                    :limit="1"
                    accept=".xls,.xlsx"
                    :data="insertProgram"
                    :auto-upload='true'
                    :on-change="handleChange"
                    :on-success="handleAvatarSuccess"
                    :on-progress="handleProgress"
                    :on-error="handleAvatarError"
                    :disabled="uploading">
                <el-button size="small" type="primary" >点击上传</el-button>
            </el-upload>
            <el-button type="success" :loading="uploading">{{upload_text}}</el-button>
        </div>
        <div>
            <el-button type="primary" @click='downLoad'>下载结算信息</el-button>
        </div>

        <div style="margin-left: 10px;">
            <el-button type="primary" @click='downLoadTableExcel'>下载表格</el-button>
        </div>
    </div>
    <el-main>
        <el-table v-loading="loading" :data="tableData" border>
            <el-table-column type="index" label="序号" width="50"></el-table-column>
            <el-table-column prop="createTime" label="提交时间"></el-table-column>
            <el-table-column prop="contentObj.onLineTime" label="上线时间"></el-table-column>
            <el-table-column prop="contentObj.stationName" label="油站名称"></el-table-column>
            <el-table-column prop="stationId" label="油站ID"></el-table-column>
            <el-table-column prop="id" label="工单ID"></el-table-column>
            <el-table-column prop="contentObj.stationFee" label="油站手续费(%)"></el-table-column>
            <el-table-column label="每天转账费(元)">1.0</el-table-column>
            <el-table-column prop="contentObj.accountName" label="油站对公账户名"></el-table-column>
            <el-table-column prop="contentObj.bankBranch" label="账户支行"></el-table-column>
            <el-table-column prop="contentObj.provinceName" label="开户省份"></el-table-column>
            <el-table-column prop="contentObj.accountCityName" label="开户城市"></el-table-column>
            <el-table-column prop="contentObj.bankAccount" label="银行账号"></el-table-column>
            <el-table-column prop="contentObj.bankName" label="银行名称"></el-table-column>
            <el-table-column prop="checkerName" label="审批人"></el-table-column>
            <el-table-column prop="checkTime" label="审批时间"></el-table-column>
            <el-table-column prop="orderNodeState2" label="工单状态"></el-table-column>
            <el-table-column label="油站证件">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="primary">查看</el-button>
                </template>
            </el-table-column>
            <el-table-column label="操作" width="180">
                <template slot-scope="scope">
                    <el-button v-if='scope.row.orderNodeState == 0' @click="onSubmitConfirm(scope.row)" type="primary">
                        通过
                    </el-button>
                    <el-button v-if='scope.row.orderNodeState == 0' @click="onSubmitreject(scope.row)" type="warning">
                        驳回
                    </el-button>
                </template>
            </el-table-column>

        </el-table>

        <div style="text-align: center;margin-top: 30px;">
            <el-pagination
                    background
                    layout="prev, pager, next"
                    :total="total"
                    @current-change="current_change"
            >
            </el-pagination>
        </div>

        <el-dialog
                :close-on-click-modal="false"
                class='dialogMask'
                center
                title=""
                :visible.sync="outerVisible"
                width="100%"
                :show-close="showClose"
                :before-close="handleClose">
            <el-carousel arrow="always" :autoplay="autoplay" indicator-position="none">
                <el-carousel-item v-for="item in bannerList" :key="item">
                    <img class="img_item" :src="item"/>
                </el-carousel-item>
                <div class="carouselClose" @click="outerVisible=false">
                    <img src="https://img.ejiayou.com/upload/2021/4/c0bd9f0c-91d1-4a32-b9e9-e04fae2c4158-1619419755646.png"/>
                </div>
            </el-carousel>
        </el-dialog>
        <el-dialog
                class='confirmMask'
                center
                width="25%"
                :visible.sync="innerVisible"
                append-to-body
                :close-on-click-modal="false"
                :show-close="false">
            <div class="confirmTitle">确认通过审核</div>
            <div slot="footer" class="dialog-footer">
                <el-button type="warning" @click="innerVisible = false">取消</el-button>
                <el-button type="primary" @click="getExchange(1)" v-loading.fullscreen.lock="fullscreenLoading">确认
                </el-button>
            </div>
        </el-dialog>
        <el-dialog
                class='confirmMask'
                center
                width="25%"
                :visible.sync="rejectShow"
                append-to-body
                :close-on-click-modal="false"
                :show-close="false">
            <div class="confirmTitle">确认驳回</div>
            <el-input
                    type="textarea"
                    :autosize="{ minRows: 4, maxRows: 4}"
                    placeholder="备注："
                    v-model="textarea2"
                    resize="none"
                    class='rejectTextarea'
            >
            </el-input>
            <div slot="footer" class="dialog-footer">
                <el-button type="warning" @click="rejectShow = false">取消</el-button>
                <el-button type="primary" v-loading.fullscreen.lock="fullscreenLoading" @click="getExchange(2)">确认
                </el-button>
            </div>
        </el-dialog>

        <!-- 审批中弹窗-->
        <el-dialog
                center
                width="60%"
                :visible.sync="auditDialogVisible"
                title="审批结果"
                :before-close="handleCloseAuditDialog" >
            <el-table v-loading="loading" :data="auditDialogTableData" border height="600">
                <el-table-column prop="id" label="序号" width="50"></el-table-column>
                <el-table-column prop="stationName" label="油站名称"></el-table-column>
                <el-table-column prop="accountName" label="油站对公账户名"></el-table-column>
                <el-table-column prop="bankAccount" label="银行账号"></el-table-column>
                <el-table-column prop="bankName" label="银行名称"></el-table-column>
                <el-table-column prop="transResult" label="交易状态"></el-table-column>
                <!--    0待审批 1 已通过 2驳回  else 0待审批 -->
                <el-table-column prop="orderNodeState" label="审批结果"></el-table-column>
                <el-table-column prop="checkTime" label="审批时间"></el-table-column>
                <el-table-column prop="checkerName" label="审批人"></el-table-column>
                <el-table-column prop="checkErrorMessage" label="处理结果"></el-table-column>
            </el-table>

            <div style="text-align: center;margin-top: 30px;">
                <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="auditTotal"
                        @current-change="auditCurrentChange"
                        @size-change="handleAuditSizeChange"
                        :current-page.sync="auditPageNum"
                        :page-size="auditPageSize"
                >
                </el-pagination>
            </div>

            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="downloadAuditResult">下载审核结果</el-button>
                <el-button @click="handleCloseAuditDialog">关闭</el-button>
            </span>
        </el-dialog>
    </el-main>
</div>
</body>
<!-- 先引入 Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="//img.ejiayou.com/activity/pages/freeOrders/js/jquery-1.9.1.min.js"></script>
<script src="//cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
<script src="//img.ejiayou.com/activity/images/groupon/common.js"></script>
<script>
    const now = new Date();
    const year = now.getFullYear();
    const month = now.getMonth();
    const day = now.getDate();

    let xcTime = 30 * 24 * 3600 * 1000;
    let cTime = now.getTime(); //获取当前系统的时间戳
    let prevTime = cTime - xcTime;
    const prevDate = new Date(prevTime);
    const prevYear = prevDate.getFullYear();
    const prevMonth = prevDate.getMonth();
    const prevDay = prevDate.getDate();
    function getActivityHost() {

        const protocol = location.protocol;

        if(window.location.origin.indexOf("dev.ejiayou.com") !== -1){
            return protocol+"//dev.ejiayou.com";
        }

        if(window.location.origin.indexOf("grey.ejiayou.com") !== -1){
            return protocol+"//grey.ejiayou.com";
        }

        if(window.location.origin.indexOf("localhost") !== -1){
            return protocol+"//localhost:8080";
        }

        return protocol+"//finance.ejiayou.com";
    }
    var vm = new Vue({
        el: '#app',
        data: function () {
            return {
                activityHost: getActivityHost(),
                userId: '',
                total: 12,
                pagesize: 10,
                currentPage: 1,
                pageNum: 1,
                outerVisible: false,
                innerVisible: false,
                rejectShow: false,
                textarea2: '',//驳回内容
                cityId: '',//城市
                createUserId: '',//商务经理
                userId4: '',//运维人员
                orderNodeState: '',
                formInline: {
                    stationName: '',
                    stationId: '',
                    workOrderId: '',
                    createStartTime: '',//工单提交开始时间
                    createEndTime: "", //工单提交结束时间
                    checkStartTime: '', //工单审核开始时间
                    checkEndTime: '', //工单审核结束时间
                    stationAccountName:''
                },
                stateList: [{
                    stateId: -1,
                    label: '请选择'
                }, {
                    stateId: 0,
                    label: '未审核'
                }, {
                    stateId: 1,
                    label: '已通过'
                }, {
                    stateId: 2,
                    label: '已驳回'
                }],
                tableData: [],
                auditDialogTableData: [], //审批弹窗table
                loading: true,
                cityList: [],
                userList2: [],
                userList4: [],
                urls: '',
                contentObj: {},
                work_order_id: '',
                orderNodeState3: '',
                fullscreenLoading: false,
                autoplay: false,
                showClose: false,
                bannerList: [],
                insertProgram: {
                    user_id: getQueryVariable('user_id')
                },

                workerCommitTime: [
                    "",
                    "",
                    // new Date(prevYear, prevMonth, prevDay, 0, 0), //创建时间开始时间 必须
                    // new Date(year, month, day, 23, 59, 59),
                ],
                workerAuditTime: [
                    "",
                    ""
                ],
                auditDialogVisible: false, //是否关闭弹窗

                auditTotal: 0,  //总长度为0
                auditPageNum: 1, //第一页 默认第一页
                auditPageSize: 50, //一页展示50行
                auditBatchno: '', //上传批次号
                uploading:false,
                upload_text:'上传审批结果'
            }
        },
        created: function () {
            this.getAllCity()
            this.getUserList2()
            this.getUserList4()
            this.getList()

        },
        mounted: function () {

        },
        methods: {
            downLoadTableExcel(){
                //debugger
                var that = this;

                var cUserId = ""
                if (cUserId) {
                    cUserId = that.userId4
                } else {
                    cUserId = getQueryVariable('user_id')
                }

                var pathUrl=that.activityHost+"/cwxt/work/station/finance/downloadStationFinances?stationName="+that.formInline.stationName
                +"&cityId="+that.cityId
                +"&createUserId="+that.createUserId
                +"&orderNoteState="+that.orderNodeState
                +"&createStartTime="+that.formInline.createStartTime
                +"&createEndTime="+that.formInline.createEndTime
                +"&checkStartTime="+that.formInline.checkStartTime
                +"&checkEndTime="+that.formInline.checkEndTime
                +"&stationAccountName="+that.formInline.stationAccountName
                +"&workOrderId="+that.formInline.workOrderId
                +"&userId="+cUserId
                window.open(pathUrl)
            },
            //当前页面
            auditCurrentChange(val) {
                this.auditPageNum = val
                //调用刷新页面的方法
                this.getWorkOrderFinanceCheckLog()
            },
            handleAuditSizeChange(val) {
                this.auditPageSize = val
                // 查询审批弹窗页面
                this.getWorkOrderFinanceCheckLog()
            },
            //下载审核结果
            downloadAuditResult() {
                var that = this
                // this.handleCloseAuditDialog() //关闭弹窗
                const url = that.activityHost + '/cwxt/work/station/finance/downloadWorkOrderFinanceCheckLog?batchno=' + that.auditBatchno;
                window.open(url);
            },
            //关闭弹窗
            handleCloseAuditDialog() {
                this.auditDialogVisible = false
            },
            //打开审批弹窗
            openAuditDialog() {
                this.auditDialogVisible = true
                this.getWorkOrderFinanceCheckLog()
            },
            //查询审批日志
            getWorkOrderFinanceCheckLog() {
                var that = this
                $.ajax({
                    type: 'GET',
                    url: that.activityHost + '/cwxt/work/station/finance/getWorkOrderFinanceCheckLog',
                    data: {
                        pageNum: that.auditPageNum,
                        pageSize: that.auditPageSize,
                        batchno: that.auditBatchno,
                    },
                    success: function (res) {
                        if (res['data']) {
                            //表格数据
                            var data = res['data']
                            that.auditTotal = data['total']
                            if (data && data['rows'] && Array.isArray(data['rows'])) {
                                that.auditDialogTableData = data['rows']
                                that.auditDialogTableData.forEach(function (aItem, index) {
                                    // <!--    0待审批 1 已通过 2驳回  else 0待审批 -->
                                    if (aItem['orderNodeState'] == 0) {
                                        aItem['orderNodeState'] = '待审核'
                                    } else if (aItem['orderNodeState'] == 1) {
                                        aItem['orderNodeState'] = '已通过'
                                    } else if (aItem['orderNodeState'] == 2) {
                                        aItem['orderNodeState'] = '驳回'
                                    } else {
                                        aItem['orderNodeState'] = '待审核'
                                    }
                                })
                            }

                        }
                    },
                    error: function (res) {

                    }
                })
            },
            changeWorkerTime(val) {
                console.log('workTime', val)

            },
            changeAuditTime(val) {
                console.log('changeAuditTime', val)
            },
            //获取所有时间格式化
            getAllTimeFormat: function (now, split) {
                let year = now.getFullYear(); //年
                let month = now.getMonth() + 1; //月
                let day = now.getDate(); //日
                let hh = now.getHours(); //时
                let mm = now.getMinutes(); //分
                let ss = now.getSeconds(); //秒
                let clock = ''
                if (split) {
                    clock = year + split;
                    if (month < 10) {
                        clock += "0";
                    }
                    clock += month + split;
                    if (day < 10) {
                        clock += "0";
                    }
                } else {
                    clock = year + '-';
                    if (month < 10) {
                        clock += "0";
                    }
                    clock += month + '-';
                    if (day < 10) {
                        clock += "0";
                    }
                }
                clock += day + " ";
                if (hh < 10) {
                    clock += "0";
                }
                clock += hh + ":";
                if (mm < 10) {
                    clock += "0";
                }
                clock += mm + ":";
                if (ss < 10) {
                    clock += "0";
                }
                clock += ss;
                return clock;
            },
            getAllCity: function () { //方案列表
                var that = this
                $.ajax({
                    type: 'GET',
                    url: that.activityHost + '/cwxt/common/city/get_all_city',
                    data: {},
                    success: function (res) {
                        if (res.code == 0) {
                            that.cityList = res.data.list
                        }
                    },
                    error: function (res) {

                    }
                })
            },
            getUserList2: function () { //商务经理
                var that = this
                $.ajax({
                    type: 'GET',
                    url: that.activityHost + '/cwxt/common/work_user/user_list',
                    data: {
                        role_type: 2
                    },
                    success: function (res) {
                        if (res.code == 0) {
                            that.userList2 = res.data.list
                        }
                    },
                    error: function (res) {

                    }
                })
            },
            getUserList4: function () { //运维人员
                var that = this
                $.ajax({
                    type: 'GET',
                    url: that.activityHost + '/cwxt/common/work_user/user_list',
                    data: {
                        role_type: 4
                    },
                    success: function (res) {
                        if (res.code == 0) {
                            that.userList4 = res.data.list
                        }
                    },
                    error: function (res) {

                    }
                })
            },
            getList: function () { //列表
                var that = this;

                var url = that.activityHost + '/cwxt/work/station/finance/getStationFinances?pageNum=' + that.pageNum + "&pageSize=" + 10;
                var cUserId = ""
                if (cUserId) {
                    cUserId = that.userId4
                } else {
                    cUserId = getQueryVariable('user_id')
                }
                var params = {
                    userId: cUserId,
                    pageSize: that.pagesize,
                    pageNum: that.pageNum,
                    stationName: that.formInline.stationName,
                    cityId: that.cityId ? that.cityId : -1,
                    createUserId: that.createUserId ? that.createUserId : -1,
                    orderNodeState: that.orderNodeState,
                    workOrderId: that.formInline.workOrderId,
                    createStartTime: that.formInline.createStartTime,
                    createEndTime: that.formInline.createEndTime,
                    checkStartTime: that.formInline.checkStartTime,
                    checkEndTime: that.formInline.checkEndTime,
                    // userId4:that.userId4, //userId4
                    stationAccountName: that.formInline.stationAccountName,
                }
                console.log('params', params)
                $.ajax({
                    type: 'POST',
                    url: url,
                    contentType: 'application/json',
                    // data: JSON.stringify({
                    //     userId: getQueryVariable('user_id'),
                    //     stationName: that.formInline.stationName,
                    //     stationId: that.formInline.stationId,
                    //     workOrderId: that.formInline.workOrderId,
                    //     cityId: that.cityId ? that.cityId : -1,
                    //     createUserId: that.createUserId ? that.createUserId : -1,
                    //     orderNodeState: that.orderNodeState
                    // }),

                    data: JSON.stringify(params),
                    success: function (res) {
                        console.log('resData', res)
                        that.loading = false
                        if (res.code === 0) {
                            that.tableData = res.data.rows
                            that.total = res.data.total
                            for (var i = 0; i < that.tableData.length; i++) {
                                var orderNodeState2 = that.tableData[i].orderNodeState
                                if (orderNodeState2 === 0) {
                                    orderNodeState2 = '未审核'
                                } else if (orderNodeState2 === 1) {
                                    orderNodeState2 = '已通过'
                                } else if (orderNodeState2 === 2) {
                                    orderNodeState2 = '已驳回'
                                } else {
                                    orderNodeState2 = '请选择'
                                }

                                that.$set(that.tableData[i], 'orderNodeState2', orderNodeState2)

                            }
                            console.log(that.tableData)

                        } else {
                            console.log(res.message)
                        }
                    },
                    error: function (res) {
                        that.loading = false
                    }
                })
            },
            downLoad: function () {//下载表格
                var createUserId = typeof (this.createUserId) === undefined ? -1 : this.createUserId;
                var cityId = typeof (this.cityId) === undefined ? -1 : this.cityId;
                var orderNodeState = typeof (this.orderNodeState) === undefined ? -1 : this.orderNodeState;
                this.urls = this.activityHost + '/cwxt/work/station/finance/downloadSettleInfoExcel?userId=' + getQueryVariable('user_id')
                    + '&stationName=' + this.formInline.stationName
                    + '&createUserId=' + createUserId
                    + '&cityId=' + cityId
                    + '&orderNodeState=' + orderNodeState
                window.open(this.urls)
            },
            onSubmit: function () {
                this.pageNum = 1
                //debugger
                //提交之前每次先判断是否转时间格式
                if (this.workerCommitTime && Array.isArray((this.workerCommitTime))) {
                    if (this.workerCommitTime.length === 2) {
                        const createStartTime = this.workerCommitTime [0]
                        const createEndTime = this.workerCommitTime [1]
                        if (
                            createStartTime &&
                            createStartTime instanceof Date &&
                            createEndTime &&
                            createEndTime instanceof Date
                        ) {
                            //将gmt格式转字符串时间戳 转Java的Date格式
                            console.log("wTime", this.workerCommitTime)
                            this.formInline.createStartTime = this.getAllTimeFormat(createStartTime)
                            this.formInline.createEndTime = this.getAllTimeFormat(createEndTime)
                            console.log("转换格式化后", this.formInline)
                        }
                    }
                }
                // workerAuditTime
                if (this.workerAuditTime && Array.isArray(this.workerAuditTime)) {
                    if (this.workerAuditTime.length === 2) {
                        const checkStartTime = this.workerAuditTime[0]
                        const checkEndTime = this.workerAuditTime[1]
                        if (
                            checkStartTime &&
                            checkStartTime instanceof Date &&
                            checkEndTime &&
                            checkEndTime instanceof Date
                        ) {
                            this.formInline.checkStartTime = this.getAllTimeFormat(checkStartTime)
                            this.formInline.checkEndTime = this.getAllTimeFormat(checkEndTime)
                        }
                    }
                }

                //置空上一次的表单参数
                if (!this.workerCommitTime) {
                    this.formInline.createStartTime = ''
                    this.formInline.createEndTime = ''
                }
                if (!this.workerAuditTime) {
                    this.formInline.checkStartTime = ''
                    this.formInline.checkEndTime = ''
                }

                // if(!this.formInline.createStartTime){
                //      this.$message({
                //           type:'info',
                //           message:'工单提交开始时间不能为空'
                //      })
                //     return;
                // }
                //非必须
                // if(!this.formInline.createEndTime){
                //     this.$message({
                //         type:'info',
                //         message:'工单提交结束时间不能为空'
                //     })
                //     return
                // }
                // if(!this.formInline.checkStartTime){
                //     this.$message({
                //         type:'info',
                //         message:'工单审核开始时间不能为空'
                //     })
                //     return
                // }
                // if(!this.formInline.checkEndTime){
                //     this.$message({
                //         type:'info',
                //         message:'工单审核结束时间不能为空'
                //     })
                //     return
                // }
                this.getList()
            },
            handleClick: function (row) {
                var that = this
                that.outerVisible = true
                that.contentObj = row.contentObj
                that.work_order_id = row.id
                that.orderNodeState3 = row.orderNodeState

                var bannerList = []
                bannerList.push(row.contentObj.businesslicensePic)
                bannerList.push(row.contentObj.startbusinesslicensePic)
                bannerList.push(row.contentObj.legalFrontPic)
                bannerList.push(row.contentObj.legalReversePic)
                bannerList.push(row.contentObj.DangerousPic)
                if (row.contentObj.contractPic) {
                    bannerList.push(row.contentObj.contractPic)
                }
                that.bannerList = bannerList
                console.log(bannerList)
            },
            current_change: function (currentPage) {
                this.loading = true
                this.currentPage = currentPage;
                this.pageNum = currentPage
                this.getList()
            },
            handleClose(done) {
                this.outerVisible = false
            },
            getExchange: function (audit) { //流转工单
                var that = this
                that.fullscreenLoading = true
                $.ajax({
                    type: 'POST',
                    url: this.activityHost + '/cwxt/work/station/finance/checkFinanceWorkOrder',
                    data: {
                        userId: getQueryVariable('user_id'),
                        workOrderId: that.work_order_id,
                        orderNodeState: audit,
                        remark: that.textarea2
                    },
                    success: function (res) {
                        that.fullscreenLoading = false
                        that.textarea2 = ''
                        that.outerVisible = false;
                        that.innerVisible = false;
                        that.rejectShow = false;
                        if (res.code == 0) {
                            that.$message.success("审批成功！");
                            that.getList();
                        } else {
                            that.$message.error(res.message);
                        }
                    },
                    error: function (res) {
                        that.fullscreenLoading = false
                        var resData = JSON.parse(res.responseText)
                        that.$message.error(resData.error.message);
                    }
                })
            },
            handleAvatarSuccess: function (res, file) {

                var that = this;

                that.uploading = false;
                that.upload_text = '上传审批结果';

                if(res.code !== 0){
                    that.$message.error("上传失败！"+res['message']);
                    this.$refs.upload.clearFiles();
                    return;
                }

                if (res && res['data']) {
                    //批次号
                    that.auditBatchno = res['data'];
                    //上传审核结果之后打开弹窗
                    this.openAuditDialog() //打开审批结果弹窗
                }
                that.$refs.upload.clearFiles();
                that.$message({message: '上传成功！', type: 'success'});
            },
            handleAvatarError: function (res, file) {
                var that = this
                that.uploading = false;
                that.upload_text = '上传审批结果';
                that.$refs.upload.clearFiles();
                that.$message.error("上传失败！");
            },
            handleProgress:function(event, file, fileList) {
                this.uploading = true;
                this.upload_text = '文件上传中'
            },
            goToPage: function (row) {
                window.open("oil_sign.html?user_id=" + getQueryVariable('user_id') + '&work_order_id=' + row.id);
            },
            onSubmitConfirm: function (row) {
                this.innerVisible = true
                this.textarea2 = ''
                this.contentObj = row.contentObj
                this.work_order_id = row.id
                this.orderNodeState3 = row.orderNodeState
            },
            onSubmitreject: function (row) {
                this.rejectShow = true
                this.textarea2 = ''
                this.contentObj = row.contentObj
                this.work_order_id = row.id
                this.orderNodeState3 = row.orderNodeState
            },
            handleChange(file, fileList) {

            }
        }
    })
</script>

</html>
